<template>
  <div class="popWin">
    <div @click="closePopUp" class="popWinBg"></div>
    <div class="popWinMain" ref="popWinMain">
      <img
        src="@/assets/close.png"
        class="closeImg"
        alt=""
        @click="closePopUp"
      />
      <div class="popTitle">{{ props.title }}</div>
      <div class="contens">
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  title: {
    type: String,
    required: true,
  },
});
const emit = defineEmits(["closePopUp"]);
const closePopUp = () => {
  emit("closePopUp");
};
</script>

<style scoped lang="scss">
.popWinBg {
  position: fixed;
  z-index: 100;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: initial;
}
.popWin {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  align-content: flex-start;
  position: fixed;
  z-index: 10;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  pointer-events: none;
}
.popWinMain {
  position: relative;
  pointer-events: initial;
  background-size: 100% 100%;
  position: relative;
  // max-height: 1004px;
  // max-width: 1642px;
  width: 74%;
  height: 92%;
  z-index: 100;
  background-image: url("@/assets/toastbg.png");
}
.popTitle {
  width: vw(391);
  height: vh(40);
  line-height: vh(40);
  margin: 0 auto;

  font-family: Source Han Sans CN;
  font-weight: 800;
  font-size: vh(18);
  color: #7afffd;
  text-align: center;
}

.closeImg {
  position: absolute;
  right: vw(-32);
  top: 0;
  width: vw(31);
  height: vw(31);
  z-index: 300;
  cursor: pointer;
}
</style>